package service.impl;

import dao.NewsDao;
import dao.impl.NewsDaoImpl;
import entity.News;
import service.NewsService;
import util.SimpleDaoFactory;

public class NewsServiceImpl implements NewsService {

    //实例化所依赖的NewsDao对象
//    private NewsDao dao= SimpleDaoFactory.getInstance();
   private NewsDao dao;

    public void setDao(NewsDao dao) {
        this.dao = dao;
    }

    public void addNews(News news){
        //调用NewsDao的方法保存新闻信息
        dao.insert(news);
    }

    @Override
    public int deleteByPrimaryKey(Integer nid) {
        return 0;
    }

    @Override
    public int insert(News record) {
        return 0;
    }

    @Override
    public int insertSelective(News record) {
        return 0;
    }

    @Override
    public News selectByPrimaryKey(Integer nid) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(News record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(News record) {
        return 0;
    }
}
